<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style type="text/css">
        .box{
                width:200px;
                height:200px;
                /* background:red; */
                margin:100px auto;
                position:relative;
                /* perspective:500px; */

                transform-style:preserve-3d;

                animation:anm 6s linear infinite;
        }
        .item{
            width:100%;
            height:100%;
            position:absolute;
            line-height:200px;
            text-align:center;
            font-size:30px;
            opacity:.5;


        }
        .item:nth-child(1){
            background:skyblue;
            transform:translateZ(100px);
        }
        .item:nth-child(2){
            background:green;
            transform:rotateY(180deg) translateZ(100px);
        }
        .item:nth-child(3){
            background:lightgray;
            transform:rotateY(90deg) translateZ(100px);
        }
        .item:nth-child(4){
            background:pink;
            transform:rotateY(-90deg) translateZ(100px);
        }
         .item:nth-child(5){
            background:yellow;
            transform:rotateX(-90deg) translateZ(100px);
        }
         .item:nth-child(6){
            background:yellowgreen;
            transform:rotateX(90deg) translateZ(100px);
        }
        @keyframes anm {
            0%{
                     transform:rotateX(360deg) rotateY(360deg);
                }



        }

    </style>
</head>
<body>
        <div class="box">
                <div class="item">1</div>
                <div class="item">2</div>
                <div class="item">3</div>
                <div class="item">4</div>
                <div class="item">5</div>
                <div class="item">6</div>
        </div>
</body>
</html>